// import 'package:native_dart_package/generated/base/json_convert_content.dart';

import '../base/jsons_convert_content.dart';
import 'paging_params.dart';

PagingParams $PagingParamsFromJson(Map<String, dynamic> json) {
  final PagingParams pagingParams = PagingParams();
  final int? current = jsonsConvert.convert<int>(json['current']);
  if (current != null) {
    pagingParams.pageNum = current;
  }
  final Map<String, dynamic>? extra =
      jsonsConvert.convert<Map<String, dynamic>>(json['extra']);
  if (extra != null) {
    pagingParams.extra = extra;
  }
  final String? order = jsonsConvert.convert<String>(json['order']);
  if (order != null) {
    pagingParams.order = order;
  }
  final int? size = jsonsConvert.convert<int>(json['size']);
  if (size != null) {
    pagingParams.pageSize = size;
  }

  final int? total = jsonsConvert.convert<int>(json['total']);
  if (total != null) {
    pagingParams.total = total;
  }
  return pagingParams;
}

Map<String, dynamic> $PagingParamsToJson(PagingParams entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['current'] = entity.pageNum;
  data['extra'] = entity.extra;

  data['order'] = entity.order;
  data['size'] = entity.pageSize;
  if (entity.extra != null) {
    data.addEntries(entity.extra!.entries);
  }

  return data;
}
